package com.javaweb.demo.dao;

import com.javaweb.demo.entity.*;

import java.io.FileNotFoundException;
import java.io.InputStream;
import java.sql.SQLException;
import java.util.List;

public interface UserDao {
    public boolean login(String name, String pwd);

    public boolean register(User user);

    public List<User> getUserAll();

    public List<SFile> getFileAll();

    public boolean delete(String name);

    public boolean update(int id,String name,String pwd,String sex,String home,String info);

    public List<User> selectUser(int id,String name,String sex,String home);

    public boolean addfriend(String username,String name,String request);

    public boolean addfriend(String username,String name);

    public boolean delfriend(String username,String name);

    public boolean deleterequest(String name,String request);

    public List<User> queryfriends(String username);

    public List<User> queryfriendrequests(String username);

    public boolean setposter(String str);

    public boolean updateposter(int id,String str);

    public boolean deleteposter(int id);

    public List<Poster> getposter();

    public boolean upload(InputStream path, String filename) throws FileNotFoundException;

    public boolean download(int id) throws SQLException;

    public List<grade> querygrades(String username);

    public List<grade> getallgrades();

    public boolean setgrade(String sname,String cname,String grade);

    public boolean updategrade(int id,String sname,String cname,String grade);

    public boolean deletegrade(int id);

    public List<message> getmessages(String receivername);

    public boolean addmessage(String delivername,String receivername,String string);
}
